<%@page import="com.athena.dal.entities.Examination"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<html>

	<head>
		<title>All Examination</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/faculty.css"/>"/>
	</head>

	<body>
		<div id="container">
			<div id="content">
				<div id="pageLinks floatRight">
					<a href="<c:url value="/faculty/exams/new"> </c:url>" class="btn btn-primary floatRight">Create Exam</a>
				</div>
				<h1>Examination</h1>
                 <c:choose>
					<c:when test="${allExams == null || allExams.isEmpty()}">
						No data available for examinations or tests for you.
					</c:when>
					<c:otherwise>
						<c:out value="Total Examinations: ${allExams.size()}" />
						<table id="allexams" class="table">
							<thead>
								<tr>
									<th>Id</th>
									<th>Subject</th>
									<th>Type</th>
									<th>Date</th>
									<th>State</th>
									<th>Full Marks</th>
									<th>Duration</th>
									<th>Examiner</th>
								</tr>
							</thead>
							<tbody>
								<% int index = 1; %>
								<c:forEach items="${allExams}" var="thisExam">
								<tr>
									<td> <c:out value="${thisExam.id}" /> </td>
									<td> <c:out value="${thisExam.subjectId}" /> </td>
									<td> <c:out value="${thisExam.getType().value()}" /> </td>
									<td> <c:out value="N/A" /> </td>
									<td> <c:out value="${thisExam.state}" /> </td>
									<td> <c:out value="${thisExam.fullMarks}" /> </td>
									<td> <c:out value="${thisExam.duration}" /> </td>
									<td> <c:out value="${thisExam.examinerFacultyId}" /> </td>
								</tr>
								</c:forEach>
							</tbody>
						</table>
					</c:otherwise>
				</c:choose>
			</div>
			
		</div>
	</body>
</html>



